package pcloud.client.worker;

import java.io.IOException;

import pcloud.client.util.FileResourceInfo;
import pcloud.client.util.Logger;

public class RemoteDeleteTask extends CloudTask
{

	public RemoteDeleteTask(FileResourceInfo fileInfo)
	{
		super(fileInfo);
	}

	public boolean doWork() throws IOException
	{
		boolean deleteSucessfully = fileService.delete(fileInfo);
		logger.info("delete file: [" + fileInfo + "] "
				+ (deleteSucessfully ? "sucessfully!" : "failed!"));
		return deleteSucessfully;
	}

	@Override
	protected boolean inTaskTriggerAfterDoWork()
	{
		return true;
	}

	@Override
	protected boolean inTaskTriggerBeforeDoWork()
	{
		return true;
	}

}
